/**
 * @author Tobias Boehm
 *
 * 09.04.2011
 */
package org.anddev.andengine.extension.tbsengine.menu.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

/**
 * This is a helper class which removes the application title bar and the phone
 * status bar {@link #onCreate(Bundle)}. It also hides all screen decorations.
 * As a result there will be a full screen application.
 * <p>
 * Derive your activity classes from this class to avoid to rewrite code.
 * 
 * @author Tobias Boehm
 *
 */
public abstract class AbsFullscreenActivity extends Activity {
	
	private void requestFullscreen() {
		
		final Window window = this.getWindow();
		
		window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
		window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
		window.requestFeature(Window.FEATURE_NO_TITLE);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
	
		super.onCreate(savedInstanceState);
		
		this.requestFullscreen();
	}
}
